All Questions
19 questions
-1votes
1answer
71views
creating hard links Linux question [duplicate]
From the book The Linux Command Line by William Shotts, page 33: So now we have four instances of the file fun. Let's take a look at our playground directory. [me@linuxbox playground]$ ls -1 total 16 ...
0votes
3answers
1kviews
ls -d command only returns `.` eg, and no child directories
I have standard ls installed, I also have lsd installed, which is a nerd-font drop-in replacement for ls. I mention this because the error may have something to do with the alias. For testing right ...
5votes
3answers
4kviews
ls -ad */ won't display hidden directories [duplicate]
pwd is my home directory. ls */ -d displays the directories. ~$ ls */ -d Blog/ Desktop/ Documents/ Downloads/ Music/ Pictures/ Public/ Templates/ Videos/ And ls -a displays all hidden ...
1vote
2answers
215views
Explaining what this command does
ls *.txt | lp Wouldn't this command list all files that end in .txt and then print them?
28votes
2answers
3kviews
Inconsistent color output from `ls` command
I teach an Intro to UNIX/Linux course at a local college and one of my students asked the following question: Why are some of the files in my directory colored white and others are gray? Are the ...
1vote
3answers
3kviews
Using ls to find files that end in a character, ignoring extension
I am supposed to use ls to find files that end in a certain letter, but it does not matter if the file has an extension or not. For example, I want it to do this > ls test test.txt test.ascii ...
0votes
1answer
544views
how to pipe ls -ltr after list of files to capture date and time
we have script that print all bad wsp files ./print_bad_wsp_files.sh ./aaaa/rrr/aaaa/fff/ooo/min.wsp ./aaaa/rrr/aaaa/fff/ooo/p50.wsp ./aaaa/rrr/aaaa/fff/ooo/min.wsp ./aaaa/rrr/aaaa/fff/ooo/p50.wsp #...
0votes
1answer
593views
Why doesn't the “ls -1” command work correctly? [closed]
I'm trying to learn linux commands, but the output wasn’t what I expected.
2votes
1answer
4kviews
Is it possible to change the default behavior of a command?
Is it possible to change the default behavior of a command? I assume that this question is pretty straight forward but let me give an illustration and example. While connected to some servers via ...
3votes
5answers
7kviews
The result of "ls | wc -l" does not match the real number of files [duplicate]
I need to count the number of files under a folder and use the following command. cd testfolder bash-4.1$ ls | wc -l 6 In fact, there are only five files under this folder, bash-4.1$ ls total 44 -rw-...
16votes
7answers
23kviews
What to use when the "ls" command doesn't work?
I tried to use the ls command and got an error: bash: /bin/ls: cannot execute binary file What can I use instead of this command?
23votes
2answers
48kviews
syntax of ls --hide= and ls --ignore=
ls --hide and ls --ignore provides the possibility leave out files defined through regular expressions set after the --ignore= part. The latter makes sure that this option isn't turned off via -a, -A. ...
161votes
10answers
443kviews
How to output only file names (with spaces) in ls -Al?
I should echo only names of files or directories with this construction: ls -Al | while read string do ... done ls -Al output : drwxr-xr-x 12 s162103 studs 12 march 28 12:49 personal ...
11votes
2answers
2kviews
Highlight the three last updated files in ls output
Is there any way to overload or wrap the ls command so that it will highlight / underline / otherwise make obvious the last three modified files? I know that I can simply ls -rtl to order by reverse ...
18votes
3answers
6kviews
Output ls -l size field with digits grouped by thousands?
It is possible to make ls -l output the size field with digits grouped by thousands? If so, how? For instance: $ ls -l -rw-rw---- 1 dahl dahl 43,210,052 2012-01-01 21:52 test.py (Note the commas in ...